package com.zretc.emptraining.serviceimpl;

import com.zretc.emptraining.daoimpl.ManagerAppDaoImp;
import com.zretc.emptraining.dbtools.PageData;
import com.zretc.emptraining.entity.ManagerApp;
import com.zretc.emptraining.service.ManagerAppService;

public class ManagerAppServiceImp implements ManagerAppService {
	ManagerAppDaoImp madi = new ManagerAppDaoImp();

	@Override
	public boolean addManagerApp(ManagerApp managerApp) {
		return madi.addManagerApp(managerApp);
	}

	@Override
	public boolean delManagerApp(int managerappNo) {
		// TODO Auto-generated method stub
		return madi.delManagerApp(managerappNo);
	}

	@Override
	public boolean passManagerApp(int managerappNo) {
		// TODO Auto-generated method stub
		return madi.passManagerApp(managerappNo);
	}

	@Override
	public PageData<ManagerApp> getManagerAppsByLike(int page, int pagesize, String keyword) {
		if(page < 1) {
			page = 1;
		}
		PageData<ManagerApp> pd = new PageData<ManagerApp>();
		pd = madi.getManagerAppsByLike(page, pagesize, keyword);
		return pd;
	}

	@Override
	public boolean UpdateManagerApp(ManagerApp managerApp) {
		// TODO Auto-generated method stub
		return madi.UpdateManagerApp(managerApp);
	}
	
	@Override
	public boolean UpdateManagerAppByAdmin(ManagerApp managerApp) {
		// TODO Auto-generated method stub
		return madi.UpdateManagerAppByAdmin(managerApp);
	}
	
	@Override
	public PageData<ManagerApp> getManagerAppByDeptNo(int page, int pageSize, int deptNo) {
		if(page < 1) {
			page = 1;
		}
		return madi.getManagerAppByDeptNo(page, pageSize, deptNo);
	}
	
	@Override
	public PageData<ManagerApp> getMnagerAppByDeptNoWithDeptName(int page, int pageSize, int deptNo, String deptName) {
		if(page < 1) {
			page = 1;
		}
		return madi.getMnagerAppByDeptNoWithDeptName(page, pageSize, deptNo, deptName);
	}
	
	@Override
	public boolean delManagerAppByAdmin(int managerappNo) {
		// TODO Auto-generated method stub
		return madi.delManagerAppByAdmin(managerappNo);
	}
	
	@Override
	public boolean refuseManagerApp(int managerappNo) {
		// TODO Auto-generated method stub
		return madi.refuseManagerApp(managerappNo);
	}
}
